﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.RepositoryFramework;

namespace Ue.Qcdz.Domain.feedbacks
{
    public class FeedbackService
    {
        private static IFeedBackRepository _repository;
        static FeedbackService()
        {
            FeedbackService._repository = RepositoryFactory.GetRepository<IFeedBackRepository,Feedback>();
        }
        public static Feedback GetFriendLinks(object FeedbackKey)
        {
            return FeedbackService._repository.FindBy(FeedbackKey);
        }
        public static IList<Feedback> GetFeedback()
        {
            return FeedbackService._repository.FindAll();
        }
        public static IDataResult<Feedback> GetFeedback(IDataQuery dataQuery)
        {
            return FeedbackService._repository.FindBy(dataQuery);
        }
        public static void AddFriendLinks(Feedback feedback)
        {
            FeedbackService._repository.Add(feedback);
        }
        public static void DeleFriendLinks(Feedback feedback)
        {
            FeedbackService._repository.Remove(feedback);
        }

        public static void UpdatePermission(Feedback feedback)
        {
            FeedbackService._repository[feedback.Key] = feedback;
        }
    }
}
